{include file="public/_header" /}
<style>
    .user_info{
        width: 50%;
        float: left;
    }
    .user_img{
        width: 50%;
        float: left;
    }
    .layui-btn{
        margin: 0px 50px;
    }
</style>
<div class="x-body">
    <form class="layui-form">
        <div class="user_info">
            <div class="layui-form-item">
                <input type="hidden" name="id" value="{$more_info.aid}">
                <label for="L_email" class="layui-form-label">
                    <span class="x-red">*</span>所属省份
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="L_email" name="province" autocomplete="off" class="layui-input" value="{$more_info.province}">
                </div>
            </div>
            <div class="layui-form-item">
                <label for="L_username" class="layui-form-label">
                    <span class="x-red">*</span>所属城市
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="L_username" name="city" autocomplete="off" class="layui-input" value="{$more_info.city}">
                </div>
            </div>
            <div class="layui-form-item">
                <label for="L_pass" class="layui-form-label">
                    <span class="x-red">*</span>真实姓名
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="L_pass" name="name" autocomplete="off" class="layui-input" value="{$more_info.nick_name}">
                </div>
            </div>
            <div class="layui-form-item">
                <label for="L_repass" class="layui-form-label">
                    <span class="x-red">*</span>所属行业
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="L_repass" name="industry" autocomplete="off" class="layui-input" value="{$more_info.name}">
                </div>
            </div>
            <div class="layui-form-item">
                <label for="L_pass" class="layui-form-label">
                    <span class="x-red">*</span>身份证号
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="L_pass" name="id_number" autocomplete="off" class="layui-input" value="{$more_info.id_card}">
                </div>
            </div>
            <div class="layui-form-item">
                <label for="L_pass" class="layui-form-label">
                    <span class="x-red">*</span>手机号码
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="L_pass" name="phone" autocomplete="off" class="layui-input" value="{$more_info.user_name}">
                </div>
            </div>
        </div>
        <div class="user_img">
            hhh
        </div>
        <div class="layui-form-item">
            <label for="L_repass" class="layui-form-label">
            </label>
            <button  class="layui-btn" lay-filter="cancel" lay-submit="">
                取消
            </button>
            <button  class="layui-btn" lay-filter="pass" lay-submit="">
                通过
            </button>
            <button  class="layui-btn" lay-filter="not_pass" lay-submit="">
                不通过
            </button>
        </div>
    </form>
</div>
{include file="public/_footer" /}
<script>
    layui.use(['form','layer'], function(){
        $ = layui.jquery;
        var form = layui.form
            ,layer = layui.layer;

        form.on('submit(cancel)', function(data){
                // 获得frame索引
                var index = parent.layer.getFrameIndex(window.name);
                //关闭当前frame
                parent.layer.close(index);
            return false;
        });

        //监听提交
        form.on('submit(pass)', function(data){
            //url
            var url = "{:url('Advertuser/change')}";
            var id = $("input[name='id']").val();
            var postData = {"id":id, "status":2};
            //发送ajax
            $.post(url, postData, function(res){
                if(res){
                    //发异步，把数据提交给php
                    layer.alert("审核成功", {icon: 6},function () {
                        // 获得frame索引
                        var index = parent.layer.getFrameIndex(window.name);
                        //关闭当前frame
                        parent.layer.close(index);
                    });
                }
            });

            return false;
        });

        form.on('submit(not_pass)', function(data){
            //url
            var url = "{:url('Advertuser/change')}";
            var id = $("input[name='id']").val();
            var postData = {"id":id, "status":3};
            //发送ajax
            $.post(url, postData, function(res){
                if(res){
                    //发异步，把数据提交给php
                    layer.alert("审核成功", {icon: 6},function () {
                        // 获得frame索引
                        var index = parent.layer.getFrameIndex(window.name);
                        //关闭当前frame
                        parent.layer.close(index);
                    });
                }
            });

            return false;
        });


    });
</script>
<script>var _hmt = _hmt || []; (function() {
    var hm = document.createElement("script");
    hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
})();</script>
</body>

</html>